package com.ljx.funchat.common.domain.dto;

import com.ljx.funchat.user.domain.enums.WSPushTypeEnum;
import com.ljx.funchat.websocket.domain.vo.resp.WSBaseResp;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PushMessageDTO implements Serializable {

    /**
     * 推送的ws消息
     */
    private WSBaseResp<?> wsBaseResp;

    /**
     * 推送的uid列表
     */
    private List<Long> ids;

    /**
     * 推送类型 1个人 2全员
     */
    private Integer pushType;

    public PushMessageDTO(List<Long> uidList, WSBaseResp<?> msg) {
        this.ids = uidList;
        this.wsBaseResp = msg;
        this.pushType = WSPushTypeEnum.PERSON.getType();
    }

    public PushMessageDTO(WSBaseResp<?> msg) {
        this.wsBaseResp = msg;
        this.pushType = WSPushTypeEnum.ALL.getType();
    }
}
